<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<title>Barcode Example</title>
		<link rel="stylesheet" href="../css/mui.min.css" />
		<script src="../js/mui.min.js"></script>
		<script type="text/javascript">
			var scan = null;
			function onmarked(type, result) {
				var text = '未知: ';
				switch(type) {
					case plus.barcode.QR:
						text = 'QR: ';
						break;
					case plus.barcode.EAN13:
						text = 'EAN13: ';
						break;
					case plus.barcode.EAN8:
						text = 'EAN8: ';
						break;
				}
				alert(text + result);
			}

			function startRecognize() {
				scan = new plus.barcode.Barcode('bcid');
				scan.onmarked = onmarked;
				scan.start();
			}
			setTimeout('startRecognize()', 500);
		</script>
		<style type="text/css">
			html,
			body {
				margin: 0px;
				padding: 0px;
				height: 100%;
			}
			
			#bcid {
				background: #000000;
				margin-top: 10%;
				height: 100%;
				width: 100%;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav" style="height: 55px;">
			<div style="margin-top: 15px;">
				<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
				<h1 class="mui-title">扫一扫</h1>
			</div>
		</header>
		<div id="bcid" style="margin-top: 55px;"></div>
	</body>

</html>